﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using MMITCore;
using MMITDomain;
using MMITDomain.Concrete;
using MMITDomain.Entities;

namespace MMITCore
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface ICoreService
    {
        
        [OperationContract]
        ResponseObject LoadMoney(string SerialNo, string PIN, int SenderId);
        
        [OperationContract]
        ResponseObject LoadMoneyExternal(string UkashVoucherNumber, int UserId,  decimal Amount, string Currency);

        [OperationContract]
        ResponseObject SendMoney(string SerialNo, string PIN, int SenderId, int RecipientId, string RecipientMSISDN, decimal Amount, string FirstName, string LastName, int IdenticationTypeId, string IdentificationNumber, int CountryId, int SendMoneyRecipientType, int PartnerId);

        //[OperationContract]
        //ResponseObject SendMoneyExternal(int SenderId, string RecipientMSISDN, decimal Amount, string FirstName, string LastName, int IdenticationTypeId, string IdentificationNumber, int recipientCountryId, string Address, int SendMoneyRecipientType);

        [OperationContract]
        ResponseObject WithdrawMoney(string token, decimal amount, string RecipientMSISDN, int AuthorisationId);

        [OperationContract]
        ResponseObject RequestToken(decimal amount, string MSISDN);

        [OperationContract]
        [ServiceKnownType(typeof(RedeemVoucher))]
        RedeemVoucher RedeemVoucher(string SerialNo, string PIN, string Username, string Password, string TransactionCode, int VoucherType, decimal Amount, decimal PurchaseValue, string Currency, string MobileNo);

        [OperationContract]      
        QueryTransaction QueryTransaction(string token);

        [OperationContract]
        [ServiceKnownType(typeof(TransactionCharges))]
         TransactionCharges GetTransactionCharges(decimal txnAmount, int transactionType);

    }

    [DataContract]
    public class QueryTransaction
    {
        [DataMember]
        public Transaction Transaction
        {
            get;
            set;
        }

        [DataMember]
        public Customer Customer
        {
            get;
            set;
        }

        //[DataMember]
        //public Account Account
        //{
        //    get;
        //    set;
        //}

        [DataMember]
        public ResponseObject ro
        {
            get;
            set;
        }

    }

    [DataContract]
    public class RedeemVoucher
    {

        [DataMember]
        public Voucher NewVoucher
        {
            get;
            set;
        }

        [DataMember]
        public ResponseObject ro
        {
            get;
            set;
        }
    
    }

    [DataContract]
    public class TransactionCharges
    {
        [DataMember]
        public List<TransactionCharge> txnCharges
        {
            get;
            set;
        }


        [DataMember]
        public ResponseObject ro
        {
            get;
            set;
        }

    }
}
